package cc.facesign.admin.enums;

import cc.facesign.common.exception.FacesignException;
import cc.facesign.common.utils.bean.R;

public enum DeptStatusType {
    ZERO(0, "正常"),
    ONE(1, "停用");

    private final Integer code;
    private final String msg;

    private DeptStatusType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static String codeOf(Integer code) {
        for (DeptStatusType value : values()) {
            if (value.code.equals(code)) {
                return value.msg;
            }
        }
        throw new FacesignException(R.ERROR, "状态码异常");
    }
}
